package com.eshop.we.controller;


import com.eshop.we.business.SuggestBusiness;
import com.eshop.we.result.Result;
import com.eshop.we.suggest.entity.Suggest;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@Api(value = "意见接口管理", description = "意见接口管理")
@RestController
@RequestMapping("/suggest")
public class SuggestController extends  BaseController {

    @Autowired
    SuggestBusiness suggestBusiness;

    @PostMapping("/addsuggest")
    public Result insertSuggest(@RequestParam(required = true) String suggest,@RequestParam(required = true) Integer userId){
        Suggest sug=new Suggest();
        sug.setSuggest(suggest);
        sug.setCtime((int)(System.currentTimeMillis()/1000));
        sug.setUserId(userId);
        suggestBusiness.insert(sug);
        return Result.success();
    }
}
